 var ssubscribeRecordObject = {
	getUrlPath:function(){
		return basePath+"/admin/subscribeRecord/";
	},
    detail:function(obj){
    	$.post(this.getUrlPath()+"detail/"+obj,function(data){
    		 $("#detailsModal").modal({
                 backdrop: 'static',
                 keyboard: false
             });
    		$("#detail-modal-body").html(data);
    	});
     },
     viewDetail:function(obj){
     	$.post(this.getUrlPath()+"viewDetail/"+obj,function(data){
     		 $("#detailsModal").modal({
                  backdrop: 'static',
                  keyboard: false
              });
     		$("#detail-modal-body").html(data);
     	});
      },
      CardinalDelete:function(obj){
    	  var r = confirm("您确定删除吗？");
    	  if(!r){
    		  return;
    	  }
    	  var callback = function(data){
    		  alert(data.Msg);
    		  if(data.state == "1"){
    			  window.location.href = basePath+"/admin/subscribeRecord/cardinalList";
    		  }
    	  }
    	  $.post(this.getUrlPath()+"CardinalDelete",{"opid":obj},callback);
      },
      audit:function(obj){
    	  var opid = $(obj).data("opid");
    	  var audit = $(obj).data("audit");
    	  var callback = function(data){
    		  alert(data.Msg);
    		  if(data.state == "1"){
    			  window.location.href = basePath+"/admin/subscribeRecord/list";
    		  }
    	  }
    	  $.post(this.getUrlPath()+"audit",{"opid":opid,"audit":audit},callback);
      },
      auditShow:function(obj,opid){
    	  $("#auditModal").modal({
              backdrop: 'static',
              keyboard: false
          });
    	  
     	  var username = $(obj).data("username");
    	  var ppname = $(obj).data("ppname");
    	  $("#auditModal_name").text(username);
    	  $("#auditModal_ppname").text(ppname);
    	  $("#auditModal-Success").attr("data-opid",opid);
    	  $("#auditModal-Fail").attr("data-opid",opid);
      }
 }
  
function queryAllPerson(pageNum,pageSize){
 	 $("#pageNum").val(pageNum);
 	 $("#pageSize").val(pageSize);
	 $("#form-select").submit();
}

function queryAllPersonView(pageNum,pageSize){
	 $("#pageNumView").val(pageNum);
	 $("#pageSizeView").val(pageSize);
	 $("#form-selectView").submit();
}

function queryAllPersonCardinal(pageNum,pageSize){
	 $("#pageCardinalNum").val(pageNum);
	 $("#pageCardinalSize").val(pageSize);
	 $("#form-cardinal-select").submit();
}
 
function clearNoNum(obj){  
    //修复第一个字符是小数点 的情况.  
    if(obj.value !=''&& obj.value.substr(0,1) == '.'){  
        obj.value="";  
    }  
    obj.value = obj.value.replace(/^0*(0\.|[1-9])/, '$1');//解决 粘贴不生效  
    obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符  
    obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的       
    obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");      
    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');//只能输入两个小数       
    if(obj.value.indexOf(".")< 0 && obj.value !=""){//以上已经过滤，此处控制的是如果没有小数点，首位不能为类似于 01、02的金额  
        if(obj.value.substr(0,1) == '0' && obj.value.length == 2){  
            obj.value= obj.value.substr(1,obj.value.length);      
        }  
    }      
} 

